<extend name="Shops:layout" />
<block name="content">
<script>
$(document).ready(function(){
    <notempty name='shopCatId1'>
    getShopCatListForAppraises('{$shopCatId1}','{$shopCatId2}');
    </notempty>
});
</script>
<script type="text/javascript">
	function changeShareShow(id){
		var isShow = $('#'+id+'_isShow').val();
		$.post(Think.U('Home/Share/changeShareShow'),{isShow:isShow,id:id},function(data){
			var json = WST.toJson(data);console.log(json);
			if(json){
				WST.msg('操作成功!', {icon: 1});
			}else{
				WST.msg('操作成功!', {icon: 5});
			}
		});
	}
</script>
<div class="wst-body"> 
<div class='wst-page-header'>卖家中心 > 晒单审核</div>
<div class='wst-page-content'>
   <div class='wst-tbar-query'>
    店铺分类：<select id='shopCatId1' autocomplete="off" onchange='javascript:getShopCatListForAppraises(this.value,"{$object['shopCatId2']}")'>
	         <option value='0'>请选择</option>
	         <volist name="shopCatsList" id="vo">
	         <option value='{$vo['catId']}' <if condition="$shopCatId1 == $vo['catId'] ">selected</if>>{$vo['catName']}</option>
	         </volist>
	     </select>
	     <select id='shopCatId2' autocomplete="off">
	         <option value='0'>请选择</option>
	     </select>
        商品：<input type='text' id='goodsName' value='{$goodsName}'/>
      <button style="border:1px solid #ffffff;height:30px;width:60px;background-color:#e23e3d;color:#ffffff;cursor: pointer;" onclick='javascript:queryShare()'>查询</button>
   </div>
   <table class='wst-list' style="margin:0 auto;">
           <thead>
             <tr>
               <th width='40'>序号</th>
               <th width='120'>商品</th>
               <th width='80'>标题</th>
               <th>图片1</th>
			   <th>图片2</th>
               <th>图片3</th>
               <th>图片4</th>
               <th>审核状态	</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='k'>
             <tr>
               <td>{$k}</td>
               <td >
               <a target='_blank' href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$vo['goodsId']))}">
						<img src="__ROOT__/{$vo['goodsThums']}" height="50" width="50"/>
			   </a>
               {$vo['goodsName']}
               </td>
                <td>
               	<div>
               		{$vo.shareTitle}
				</div>
				</td>
               <td>
               	<div>
               		<if condition="$vo['shareImg1'] neq ''">
               			<img width='100' height='100' src="/{$vo.shareImg1}" />
               		</if>
				</div>
				</td>
				<td>
               	<div>
                	<if condition="$vo['shareImg2'] neq ''">
               			<img width='100' height='100' src="/{$vo.shareImg2}" />
               		</if>
				</div>
				</td>
				<td>
				<div>
               		<if condition="$vo['shareImg3'] neq ''">
               			<img width='100' height='100' src="/{$vo.shareImg3}" />
               		</if>
				</div>
                </td>
                <td>
				<div>
               		<if condition="$vo['shareImg4'] neq ''">
               			<img width='100' height='100' src="/{$vo.shareImg4}" />
               		</if>
				</div>
                </td>
                <td>
				<div>
               		<select id="{$vo['id']}_isShow" onchange="javascript:changeShareShow({$vo['id']})">
               			<option value='0' <if condition="$vo['isShow'] eq 0">selected="selected"</if>>待审核</option>
               			<option value='1' <if condition="$vo['isShow'] eq 1">selected="selected"</if>>通过</option>
               			<option value='-1' <if condition="$vo['isShow'] eq -1">selected="selected"</if>>拒绝</option>
               		</select>
				</div>
                </td>
             </tr>
             <tr>
               <td colspan='8' align="left">评价[{$vo['loginName']}]：{$vo['shareContent']}</td>
             </tr>
             </volist>
           </tbody>
           <tfoot>
             <tr>
                <td colspan='8' align='center'>
                <div class="wst-page" style="float:right;padding-bottom:10px;">
						<div id="wst-page-items"></div>
				</div>
                <script>
			    <if condition="$Page['totalPage'] gt 1">
			    $(document).ready(function(){
					laypage({
					    cont: 'wst-page-items',
					    pages: {$Page['totalPage']}, //总页数
					    skip: true, //是否开启跳页
					    skin: '#e23e3d',
					    groups: 3, //连续显示分页数
					    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
					        var page = location.search.match(/p=(\d+)/);
					        return page ? page[1] : 1;
					    }(), 
					    jump: function(e, first){ //触发分页后的回调
					        if(!first){ //一定要加此判断，否则初始时会无限刷新
					        	var nuewurl = WST.splitURL("p");
					        	var ulist = nuewurl.split("?");
					        	if(ulist.length>1){
					        		location.href = nuewurl+'&p='+e.curr;
					        	}else{
					        		location.href = '?p='+e.curr;
					        	}
					            
					        }
					    }
					});
			    });
				</if>
				</script>
                </td>
             </tr>
             </tfoot>
        </table>
</div>
</div>
</block> 